function updateGood(obj) {
    var form = document.getElementById('form');
    var goodId=document.getElementById("goodId" + obj.id);
    console.log(goodId.innerHTML);
    var input = document.createElement("input");
    input.setAttribute("type", 'hidden');
    input.setAttribute("name", 'goodId');
    input.setAttribute("value", goodId.innerHTML);
    form.appendChild(input);
    console.log(input);
    form.action = "/admin/updateGood"
    form.submit();
}
function deleteGood(obj){
    var form = document.getElementById('form');
    var input = document.createElement("input");
    input.setAttribute("type", 'hidden');
    input.setAttribute("name", 'goodId');
    input.setAttribute("value", obj.id);
    form.appendChild(input);
    form.action = "/admin/deleteGood"
    form.submit();
}
function changeGood(obj){
    var form = document.getElementById('form');
    var input = document.createElement("input");
    input.setAttribute("type", 'hidden');
    input.setAttribute("name", 'goodId');
    input.setAttribute("value", obj.id);
    var input1 = document.createElement("input");
    input1.setAttribute("type", 'hidden');
    input1.setAttribute("name", 'goodType');
    input1.setAttribute("value", document.getElementById('goodType').value);
    console.log("1")
    var input2 = document.createElement("input");
    input2.setAttribute("type", 'hidden');
    input2.setAttribute("name", 'goodHeader');
    input2.setAttribute("value", document.getElementById('goodHeader').value);
    console.log("2")
    var input3 = document.createElement("input");
    input3.setAttribute("type", 'hidden');
    input3.setAttribute("name", 'goodDescription');
    input3.setAttribute("value", document.getElementById('goodDescription').value);
    console.log("3")
    var input4 = document.createElement("input");
    input4.setAttribute("type", 'hidden');
    input4.setAttribute("name", 'goodMeta');
    input4.setAttribute("value", document.getElementById('goodMeta').value);
    console.log("4")
    var input5 = document.createElement("input");
    input5.setAttribute("type", 'hidden');
    input5.setAttribute("name", 'goodImage');
    input5.setAttribute("value", document.getElementById('goodImage').value);
    console.log("5")
    form.appendChild(input);
    form.appendChild(input1);
    form.appendChild(input2);
    form.appendChild(input3);
    form.appendChild(input4);
    form.appendChild(input5);
    form.action = "/admin/changeGood"
    form.submit();

}
function toVersion(obj) {
    var form = document.getElementById('form');
    var input = document.createElement("input");
    input.setAttribute("type", 'hidden');
    input.setAttribute("name", 'goodId');
    input.setAttribute("value", obj.id);
    form.appendChild(input);
    form.action="/admin/showVersion"
    form.submit();
}

